package com.zjxny;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import cn.hutool.json.JSONUtil;

public class DtalkExample {

	public static void main(String[] args) {

    	String cookieStr = "JSESSIONID-L=b387dae6-8c58-42b7-ba49-8b8dba1989e7; Path=/; HttpOnly";


    	List<Map<String, String>> cookieList = Arrays.stream(cookieStr.split(";"))
    		.filter(s->s.contains("="))
    	    .map(s -> {
    	        Map<String, String> map = new HashMap<>();
    	        String[] parts = s.split("=");
    	        map.put(parts[0].trim(), parts[1].trim());
    	        return map;
    	    })
    	    .collect(Collectors.toList());
    	
    	System.err.println(JSONUtil.toJsonPrettyStr(cookieList));

	}
}
